define("pages/jls_cs/djcpForm", [
        '../../pages/jls_cs/djcpForm.html.js',
        "../../plugins/artTemplate/artTemplate",
        "../../common/componts",
    ],
    function(require){
        var dialog;
        var tsdjid="jbxxId";
        var _show=function(_jbxx){
            console.log("ss")
            var tmp= require("../../pages/jls_cs/djcpForm.html");
            console.log(tmp);
            var comonts = require("../../common/componts");
            var template=require( "../../plugins/artTemplate/artTemplate");
            var htmlcompile = template.compile(tmp);
            /*var _blr=loginuser.username;//获取当前办理人*/
            var html = htmlcompile(
                {
                    jbxx:_jbxx,
                    /*blr:_blr,*/
                });
            console.log("dd"+html)
            $("#dialog").dialog('destroy')  //使用destroy来销毁dialog
            $("#tsdjdialog").html(html);  //取出id为tsdjdialog元素的内容
            $.parser.parse($("#tsdjdialog"));  //动态渲染
            //初始化下拉框
            comonts.initSelectPage(undefined);
            comonts.initSelect(undefined,undefined,undefined);
            /*comboinputEvent();*/
            $('#dialog').window('open');
            bindAction();//refresh刷新
        }
        var bindAction=function(){
            $("#xsqkdj_save").on("click",function(){
                //新增保存功能
                var validate=$("#dialog").form('validate');
                if (validate) {
                    var data =$("#xsqkdj_form").serialize();
                    submitLoad();
                    $.ajax({
                        type : "POST",  //提交方式
                        url : "/jls_cs/dqwgclAdd",//路径
                        data : data,//数据，这里使用的是Json格式进行传输
                        success : function(result) {
                            if (result.success) {
                                javascript:$('#dialog').dialog('close');
                                $.messager.alert("确定","保存成功","info");
                                if($.isFunction()){
                                }
                            }else{
                                removeLoad();
                                $.messager.alert("确定",result.msg,"info");  //提示保存失败||该人的还有其他相关流程未走完！！
                            }
                        },
                        complete:function(){
                            removeLoad();
                        },
                    });
                }else{
                    $.messager.alert("提示", '必填项不能为空！');
                }
            });
            $("#ts_aqjc_cancle").on("click",function(){
                $("#dialog").dialog("close");
            });
        }
        return{
            show:_show
        }
    });